<script>
    // 在这行下面添加代码
    if (navigator.geolocation){
        navigator.geolocation.getCurrentPosition(function(position) {
            document.getElementById('data').innerHTML="latitude: "+ position.coords.latitude + "<br>longitude: " + position.coords.longitude;
        });
    }

    // 在这行上面添加代码
</script>
<h4>You are here:</h4>
<div id="data">

</div>